import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const router = new VueRouter({
	mode: 'history',
	routes: [
		{
			path: '/',
			component: () => import('./../views/login.vue'),
		},
		{
			path: '/home',
			redirect: '/home/shoppingMall',
			component: () => import('./../views/home.vue'),
			children: [
				{
					path: 'shoppingMall',
					component: () =>
						import('./../views/selectBrand/shoppingMall.vue'),
				},
				{
                    path: 'selectionPage',
                    component: () => import('./../views/selectBrand/selectionPage.vue'),
                },
				{
					path: 'aiSelection',
					component: () =>
						import('./../views/selectBrand/aiSelection.vue'),
				},
				{
					path: 'newProduct',
					component: () =>
						import('./../views/selectBrand/newProduct.vue'),
				},
				{
					path: 'superFactory',
					component: () =>
						import('./../views/manuFacture/superFactory.vue'),
				},
				{
					path: 'aidedDesign',
					component: () =>
						import('./../views/manuFacture/aidedDesign.vue'),
				},
				{
					path: 'doOEM',
					component: () => import('./../views/manuFacture/doOEM.vue'),
				},
				{
					path: 'doOEDM',
					component: () => import('./../views/manuFacture/doODM.vue'),
				},
				{
					path: 'propertyRight',
					component: () =>
						import('./../views/service/propertyRight.vue'),
				},
				{
					path: 'taxRefund',
					component: () => import('./../views/service/taxRefund.vue'),
				},
				{
					path: 'proxyShipping',
					component: () =>
						import('./../views/service/proxyShipping.vue'),
				},
				{
					path: 'paymentCollection',
					component: () =>
						import('./../views/service/paymentCollection.vue'),
				},
				{
					path: 'myOrder',
					component: () => import('./../views/myOrder/myOrder.vue'),
				},
				{
					path: 'itemDetail',
					component: () =>
						import('./../views/itemDetail/itemDetail.vue'),
				},
				{
					path: 'OrderDetail',
					component: () =>
						import('./../views/myOrder/OrderDetail.vue'),
				},
				{
					path: 'ApplicationForm',
					component: () =>
						import('./../views/myOrder/ApplicationForm.vue'),
				},
				{
					path: 'InquiryDetail',
					component: () =>
						import('./../views/myOrder/InquiryDetail.vue'),
				},
			],
		},{
            path: "/factoryCheckIn",
            component: () => import("./../views/factoryCheckIn/factoryCheckIn.vue")
        }
	],
});
// 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}
export default router